package com.y.demo.mapper;

import com.y.demo.entity.LoginUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LoginMapper {
    //新增用户
    @Insert("insert into loginuser(username,ip,create_time,update_time,password,is_deleted) values(#{username},#{ip},#{create_time},#{update_time},#{password},#{is_deleted})")
    int addUser(@Param("username")String username, @Param("ip")String ip,@Param("create_time")String create_time, @Param("update_time")String update_time,@Param("password")String password, @Param("is_deleted")String is_deleted);
    //查询用户
    @Select("select * from loginuser")
    List<LoginUser> selectAll();


    @Select("select * from loginuser where username=#{name}")
    LoginUser selectOneByName(String name);

}
